﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;

namespace LogManager.Base
{
    /// <summary>
    /// Represents a event in a log
    /// This is the basic event for an event without a specific type
    /// </summary>
    public class Event : IEvent
    {
        private IDictionary<string, string> _properties;

        /// <summary>
        /// Initializes the dictionary object
        /// </summary>
        public Event()
        {
            _properties = new Dictionary<string, string>();
        }

        public void Initialize(string serverName, string logName)
        {
            ServerName = serverName;
            LogName = logName;
        }

        #region IEvent Members
        public string LogName { get; set; }
        public string ServerName { get; set; }
        public string Type { get; set; }
        public string Id { get; set; }
        public string Message { get; set; }
        public string User { get; set; }
        public DateTime TimeStamp { get; set; }
        public string Level { get; set; }

        public IDictionary<string, string> Properties
        {
            get { return _properties; }
            set { _properties = value; }
        }

        public IEnumerable<string> UndefinedProperties { get; set; }

        #endregion
    }
}
